﻿from django.db import models

# Create your models here.

class Person(models.Model):
    # Name section
    idnum = models.IntegerField(unique=True)
    name = models.CharField(max_length=50)
    surname = models.CharField(max_length=50)
    nickname = models.CharField(max_length=100, blank=True, blank=True)
    fullname = models.CharField(max_length=250)
    
    # Personal section
    sex = models.CharField(max_length=12, blank=True)
    marriage = models.CharField(max_length=50, blank=True)
    birhday = models.DateField(blank=True)
    bith_city = models.CharField(max_length=100, blank=True)
    politics = models.CharField(max_length=50, blank=True)
    religion = models.CharField(max_length=100, blank=True)
    
    # Contact section
    mobile = models.CharField(max_length=30, blank=True)
    telephone = models.CharField(max_length=100, blank=True)
    icq = models.CharField(max_length=20, blank=True)
    city = models.CharField(max_length=100, blank=True)
    address = models.CharField(max_length=100, blank=True)
    website = models.CharField(max_length=100, blank=True)
    forum = models.CharField(max_length=100, blank=True)
    
    def __unicode__(self):
        return self.fullname
    
    class Admin:
        pass

class Nick(models.Model):
    place_address = models.CharField(max_length=100, blank=True)
    place_title = models.CharField(max_length=250, blank=True)
    nick = models.CharField(max_length=100, blank=True)
    reg_date = models.DateField(blank=True)
    idnum = models.IntegerField()
    
    def __unicode__(self):
        return self.idnum
    
    class Admin:
        pass
    
class Group(models.Model):    
    # Класс описываюзий группы. Как-нибудь потом
    group_idnum = models.IntegerField(unique=True)
    title = models.CharField(max_length=250)
    #description =""
    
    class Admin:
        pass
    
    def __unicode__(self):
        return self.title

class MyGroup(models.Model):
    # Класс соотносящий человека и группу
    idnum = models.IntegerField()
    group_idnum = models.IntegerField()
    
    class Admin:
        pass

